/**
 * Alibaba.com.cn Inc.
 * Copyright (c) 2004-2021 All Rights Reserved.
 */
package com.yongbao.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @author zhanghong
 * @version OssConfig.java, v 0.1 2023/8/8 16:51 下午 OssConfig Exp $$
 */
@Configuration
public class OssConfig {

    @Resource
    private OssProperties ossProperties;

    @Bean(name = "ossClient")
    public OSS amazonS3Client () {
        OSS ossClient = new OSSClientBuilder().build(ossProperties.getEndPoint(), ossProperties.getAccessKey(), ossProperties.getSecretKey());
        return ossClient;
    }
}
